#CMake最低版本
cmake_minimum_required(VERSION 3.0)

#项目名称
project(video_nonlinear)

#设置c++编译器
#set(cmake_cxx_compiler "g++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -fopenmp")

# 设定可执行二进制文件的目录（最后生成的可执行文件放置的目录）
set(EXECUTABLE_OUTPUT_PATH ../bin)
find_package(Threads)
# 设定链接目录
#LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/lib)
 
# 设定头文件目录
#INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)

#设置包含目录路径
include_directories(./utils)
include_directories(./http)
include_directories(./httpclient)
include_directories(./json)
include_directories(./module_record)
include_directories(./module_cut)
include_directories(./module_merge)

#设置源文件目录变量
aux_source_directory(./utils UTILS_DIR)
aux_source_directory(./http HTTP_DIR)
aux_source_directory(./httpclient HTTPCLIENT_DIR)
aux_source_directory(./json JSON_DIR)
aux_source_directory(./module_record RECORD_DIR)
aux_source_directory(./module_cut CUT_DIR)
aux_source_directory(./module_merge MERGE_DIR)
aux_source_directory(. DIR_SRCS)
#指示变量DIR_SRCS中的文件需要编译成为一个名称为main的可执行文件

add_executable(video_nonlinear               
              ${UTILS_DIR} ${HTTP_DIR} ${HTTPCLIENT_DIR} ${JSON_DIR}
              ${RECORD_DIR} ${CUT_DIR} ${MERGE_DIR} 
              ${DIR_SRCS})

target_link_libraries(video_nonlinear ${CMAKE_THREAD_LIBS_INIT})